package com.qiyi.player.core.video.provider.actors.clientp2p
{
   import flash.net.SharedObject;
   import com.qiyi.player.core.Config;
   
   public class ClientP2PCheck extends Object
   {
      
      public function ClientP2PCheck() {
         super();
      }
      
      public static function checkPort() : uint {
         var so:SharedObject = null;
         var port:uint = 0;
         try
         {
            so = SharedObject.getLocal(Config.CLIENT_P2P_COOKIE,"/");
            if((so) && (so.data.ACC) && !(so.data.ACC.port == undefined))
            {
               port = so.data.ACC.port;
            }
         }
         catch(e:Error)
         {
         }
         return port;
      }
      
      public static function clearPort() : void {
         var so:SharedObject = null;
         try
         {
            so = SharedObject.getLocal(Config.CLIENT_P2P_COOKIE,"/");
            if(so.data.ACC == null)
            {
               so.data.ACC = {};
            }
            so.data.ACC.port = 0;
            so.flush();
         }
         catch(e:Error)
         {
         }
      }
   }
}
